Class FileGenerator

Summary

Fully Qualified Name: Zend\Code\Generator\FileGenerator
Extends: AbstractGenerator

Description

Methods

Name Description Defined By
__construct() Passes $options to {@link setOptions()}. FileGenerator
fromArray() FileGenerator
fromReflectedFileName() Use this if you intend on generating code generation objects based on the same file. FileGenerator
fromReflection() FileGenerator
generate() FileGenerator
getBody() FileGenerator
getClass() FileGenerator
getClasses() FileGenerator
getDocBlock() FileGenerator
getFilename() FileGenerator
getIndentation() AbstractGenerator
getNamespace() FileGenerator
getRequiredFiles() FileGenerator
getSourceContent() AbstractGenerator
getUses() Returns an array with the first element the use statement, second is the as part. FileGenerator
isSourceDirty() FileGenerator
setBody() FileGenerator
setClass() FileGenerator
setClasses() FileGenerator
setDocBlock() FileGenerator
setFilename() FileGenerator
setIndentation() AbstractGenerator
setNamespace() FileGenerator
setOptions() AbstractGenerator
setRequiredFiles() FileGenerator
setSourceContent() AbstractGenerator
setSourceDirty() AbstractGenerator
setUse() FileGenerator
setUses() FileGenerator
write() FileGenerator

Method Details

__construct()

Passes $options to {@link setOptions()}.

Parameter Name Type Description
$options array|\Traversable

Returns:

fromArray()

Parameter Name Type Description
$values array

Returns: \FileGenerator

fromReflectedFileName()

Use this if you intend on generating code generation objects based on the same file.

This will keep previous changes to the file in tact during the same PHP process

Parameter Name Type Description
$filePath string
$includeIfNotAlreadyIncluded bool

Returns: \FileGenerator

fromReflection()

Parameter Name Type Description
$fileReflection \FileReflection

Returns: \FileGenerator

generate()

Returns: string

getBody()

Returns: string

getClass()

Parameter Name Type Description
$name string

Returns: \ClassGenerator

getClasses()

Returns: \ClassGenerator[]

getDocBlock()

Returns: \DocBlockGenerator

getFilename()

Returns: string

getIndentation()

Returns: string

getNamespace()

Returns: string

getRequiredFiles()

Returns: array

getSourceContent()

Returns: string

getUses()

Returns an array with the first element the use statement, second is the as part.

If $withResolvedAs is set to true, there will be a third element that is the "resolved" as statement, as the second part is not required in use statements

Parameter Name Type Description
$withResolvedAs bool

Returns: array

isSourceDirty()

Returns: bool

setBody()

Parameter Name Type Description
$body string

Returns: \FileGenerator

setClass()

Parameter Name Type Description
$class array|string|\ClassGenerator

Returns: \FileGenerator

setClasses()

Parameter Name Type Description
$classes array

Returns: \FileGenerator

setDocBlock()

Parameter Name Type Description
$docBlock \DocBlockGenerator|array|string

Returns: \FileGenerator

setFilename()

Parameter Name Type Description
$filename string

Returns: \FileGenerator

setIndentation()

Parameter Name Type Description
$indentation string

Returns: \AbstractGenerator

setNamespace()

Parameter Name Type Description
$namespace string

Returns: \FileGenerator

setOptions()

Parameter Name Type Description
$options array|\Traversable

Returns: \AbstractGenerator

setRequiredFiles()

Parameter Name Type Description
$requiredFiles array

Returns: \FileGenerator

setSourceContent()

Parameter Name Type Description
$sourceContent string

Returns: \AbstractGenerator

setSourceDirty()

Parameter Name Type Description
$isSourceDirty bool

Returns: \AbstractGenerator

setUse()

Parameter Name Type Description
$use string
$as null|string

Returns: \FileGenerator

setUses()

Parameter Name Type Description
$uses array

Returns: \FileGenerator

write()

Returns: \FileGenerator

Top